import React, { useCallback, useState } from 'react'
import MyComp1 from './components/MyComp1'
import MyComp2 from './components/MyComp2'
import MyComp3 from './components/MyComp3'

function APP() {
  const [status, setStatus] = useState(true)
  const [title1, setTitle1] = useState(1)
  return (
    <>
      <div>测试生命周期</div>
      <div>
        {status && <MyComp1 title={title1} />}
        <button
          onClick={() => {
            setStatus(!status)
          }}
        >
          显示/隐藏
        </button>
        <button
          onClick={() => {
            setTitle1(title1 + 1)
          }}
        >
          + 1
        </button>
      </div>
      <div>{!status && <MyComp2 title={title1} />}</div>
    </>
  )
}

export default APP
